import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute ,browserHistory} from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import {routerReducer } from 'react-router-redux'

import * as reducers from './reducers/LoginReducer'
import './index.css';
import App from './App';
import Home from './components/Home';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
// import registerServiceWorker from './registerServiceWorker';


const initState = ()=>{
    return {

    }
}

const reducer = combineReducers({
    ...reducers,
    routing: routerReducer
})
const store = createStore(
    reducer,initState()
)
const history = syncHistoryWithStore(browserHistory, store)

ReactDOM.render(
    <Provider store={store}>
        <MuiThemeProvider muiTheme={getMuiTheme()}>
    <div>
        <Router history={history}>
            <Route path="/" component={App}>
                <IndexRoute component={Home}/>
                <Route path="jsSip/" component={Home}/>
            </Route>
        </Router>

    </div>
        </MuiThemeProvider>
</Provider>, document.getElementById('root'));
// registerServiceWorker();
